<?php session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>SIGBio Abstract Dissertation Repository</title>
		<link rel="stylesheet" type="text/css" href="CSS/style.css">
	</head>
	<body>
	<div class= "wrapper"> 
		<div id="canvas">
				<div id="header">
						<div class="center_h">
							<div id="banner" class="contain_width">
								<div id="banner_top">
									<img src="./images/ACMlogo.jpg"><img src="./images/SigBio.jpg"><!-- <br><div class="headerDivider"></div> -->
									<!-- <div id="title"> -->
										<h1>SIGBio Dissertation<br>Abstract Repository</h1>
									<!-- </div> -->
								</div>
								<div id="nav-menu">
									<li><a href = "home.php"> Home</a></li>
									<li><a href = "newAbstract.php"> New Abstract</a></li>
									<li><a href = "searchAbstracts.php"> Search Abstracts</a></li>
									<?php
										include 'getUserLists.php';
										
										$userPages = array();
										$userPages['default'] = "/";
										$userPages['home'] = "index.php";
										$userPages['login'] = "login.php";
										$userPages['home2'] = "home.php";
										
										$reviewerPages = array();
										$reviewerPages['search'] = "searchAbstracts.php";
										
										$adminPages = array();
										
										$relURL = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], '/') + 1);
										
										if (!isset($_SESSION['user']) && !in_array($relURL, $userPages)) { // You are not logged in and are on a user page you are not allowed to view
											// echo "<li><span class = 'login_status'><a href='login.php'> Login </a></span></li>";
											// echo "</div></div><div id='content'>";
											// echo "This page is restricted to ACM members only. Please log in using your ACM ID and Password.";
											// require('footer.php');
											// die();
										}
										else if (!isset($_SESSION['user']) && in_array($_SERVER["REQUEST_URI"], $userPages)) { // You are not logged in but are on an accessible page
											echo "<li><span class = 'login_status'><a href='login.php'> Login </a></span></li>";
										}
										else if (isset($_SESSION['user'])) { //You are logged in
											echo "<li><span class = 'login_status'><a href='logout.php'> Logout </a></span></li>";
										}
										
										if (isset($_SESSION['user']) && !in_array($_SESSION['user'], $reviewers)  && in_array($relURL, $reviewerPages)) { //Not a reviewer, trying to view reviewer page.
											echo "</div></div></div></div><div id='content'><div class='center_h'>";
											echo "This page is restricted to approved reviewers only.";
											require('footer.php');
											die();
										}
										else if (isset($_SESSION['user']) && !in_array($_SESSION['user'], $admins)  && in_array($relURL, $adminPages)) { //Not an admin, trying to view an admin page. 
											echo "</div></div></div></div><div id='content'><div class='center_h'>";
											echo "This page is restricted to administrators only.";
											require('footer.php');
											die();
										}
									?>
								</div>
							</div>
						</div>
				</div>
			<div id = "content">
				<div class="center_h">